Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make PyType::name abi3 compatible #1166

Merged
merged 1 commit into from
Sep 9, 2020
Merged

Make PyType::name abi3 compatible #1166

merged 1 commit into from
Sep 9, 2020

Conversation

alex
Copy link
Contributor

@alex alex commented Sep 8, 2020

No description provided.

@kngwyu
Copy link
Member

kngwyu commented Sep 8, 2020

Some points:

  • How about __qualname__?
  • If we have to extract String, we don't have to return Cow<str>. This is a minor API and complete compatibility is not required unless it is noted in the CHANGELOG.
  • For the same reason above, we can return PyResult if it is needed.
    • This can break the user code, but T to Result<T, ...> is a really common API change in Rust and not very irritating.

@alex
Copy link
Contributor Author

alex commented Sep 8, 2020

Ah yes, __qualname__ looks much better!

Copy link
Member

@kngwyu kngwyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, suggested some minor changes

src/err.rs Outdated Show resolved Hide resolved
src/types/typeobject.rs Outdated Show resolved Hide resolved
@alex alex force-pushed the abi3-name branch 4 times, most recently from f150278 to 31f8900 Compare September 8, 2020 15:26
tests/test_methods.rs Outdated Show resolved Hide resolved
@alex
Copy link
Contributor Author

alex commented Sep 8, 2020

sorry this has taken so many revisions

The implementation is more complex, because there's no equivalent to tp_name in the limited API
@kngwyu
Copy link
Member

kngwyu commented Sep 9, 2020

Thanks!

@kngwyu kngwyu merged commit a009c23 into PyO3:abi3 Sep 9, 2020
@alex alex deleted the abi3-name branch September 9, 2020 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants